package com.sanen.flyer.entity;

import com.sanen.flyer.common.Animation;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @author wsse
 * @date 2018-09-20 9:01
 */
public class Jet extends FlyObject{
    FlyObject fly;
    BufferedImage img;
//    x,y轴坐标偏移量
    int xOffset;
    int yOffset;
    Animation anim;
    public Jet(FlyObject fly, BufferedImage img, int xOffset, int yOffset) {
        this.fly = fly;
        this.img = img;
        this.xOffset = xOffset;
        this.yOffset = yOffset;
        this.width=img.getWidth()/2;
        this.x=fly.getX()+xOffset-width/2;
        this.y=fly.getY()+yOffset;
        anim=new Animation(this,img,2,10,-1);
    }

    public void logic() {

    }

    public void move() {
        this.x=fly.getX()+xOffset-width/2;
        this.y=fly.getY()+yOffset;
    }

    public void draw(Graphics g) {
        super.draw(g);
        anim.draw(g);
    }

    public boolean outOfBounds() {
        return false;
    }

    public boolean touchBounds() {
        return false;
    }
}
